package cn.wggf.dev.qcgg.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

public class ResultUtil {
	
	public static String urlEncoder(String code,String message,Object data) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("code", code);
		result.put("message", message);
		result.put("data", data);
		String encode = "0";
		try {
			encode = URLEncoder.encode(JSONUtil.mapToJson(result), "utf-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return encode;
	}
}
